package com.boarsoft.log.entity;

import java.io.Serializable;

/**
 * @Description: 脱敏规则
 * @Author: 刘超
 * @Date: 2023-06-06 8:44
 */
public class DesensitiveRule implements Serializable {
    private static final long serialVersionUID = 6807891291000046728L;

    /**
     * 脱敏正则表达式
     */
    private String regex;

    /**
     * 脱敏规则,两种格式：“start,end”、“key<(start,end)”或“key>(start,end)”
     * <br/> key - 关键字
     * <br/> < - 表示“key”关键字左边的字符串进行替换
     * <br/> 例如:
     * <br/> 邮箱“@<(2,5)”：12345678@qq.com -> 12***678@qq.com
     * <br/> > - 表示“key”关键字右边的字符串进行替换
     * <br/> 例如:
     * <br/> 座机“->(2,5)”：010-12345678 -> 010-12***678
     * <br/> start,end - 表示从start+1位置开始到end位置替换为*
     */
    private String rule;

    public DesensitiveRule() {
    }

    public DesensitiveRule(String regex, String rule) {
        this.regex = regex;
        this.rule = rule;
    }

    public String getRegex() {
        return regex;
    }

    public void setRegex(String regex) {
        this.regex = regex;
    }

    public String getRule() {
        return rule;
    }

    public void setRule(String rule) {
        this.rule = rule;
    }
}
